package com.aat.read.test;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class ZhuiShu01 {

	public static void main(String[] args) {
		CloseableHttpClient client = HttpClients.createDefault();
		CloseableHttpResponse resp = null;
		HttpGet get = new HttpGet("http://m.zhuishushenqi.com/book/5816b415b06d1d32157790b1/1");
		try {
			resp = client.execute(get);
			HttpEntity entity = resp.getEntity();
			String res = EntityUtils.toString(entity);
			System.out.println(res);
			EntityUtils.consume(entity);

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			get.releaseConnection();

			try {
				if (resp != null) {
					resp.close();
				}
				
				if (client != null) {
					client.close();
				}
				
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

	}

}
